package cn.iocoder.an.module.business.dal.mysql.auditplandetail;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.business.dal.dataobject.auditplandetail.AuditPlanDetailDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.business.controller.admin.auditplandetail.vo.*;

/**
 * 审核填报 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface AuditPlanDetailMapper extends BaseMapperX<AuditPlanDetailDO> {

    default PageResult<AuditPlanDetailDO> selectPage(AuditPlanDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AuditPlanDetailDO>()
                .eqIfPresent(AuditPlanDetailDO::getAuditTypeId, reqVO.getAuditTypeId())
                .likeIfPresent(AuditPlanDetailDO::getAuditTypeName, reqVO.getAuditTypeName())
                .eqIfPresent(AuditPlanDetailDO::getConfigId, reqVO.getConfigId())
                .likeIfPresent(AuditPlanDetailDO::getConfigName, reqVO.getConfigName())
                .eqIfPresent(AuditPlanDetailDO::getDutyUserId, reqVO.getDutyUserId())
                .betweenIfPresent(AuditPlanDetailDO::getCreateTime, reqVO.getCreateTime())
                .inIfPresent(AuditPlanDetailDO::getPlanAreaId,reqVO.getHasSubmit())
                .ne(AuditPlanDetailDO::getAuditResult, reqVO.getAuditResult())
                .orderByDesc(AuditPlanDetailDO::getId));
    }

}